package com.ourteam.product.requirement.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 CST 2017
 * Auto Generate Date : 2018-05-03 16:46:02
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductIssueNoteBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.requirement.dao.IProductIssueNoteDAO.Id);

        mappedDaoFields.put("issueId",
            com.ourteam.product.requirement.dao.IProductIssueNoteDAO.IssueId);

        mappedDaoFields.put("noteContent",
            com.ourteam.product.requirement.dao.IProductIssueNoteDAO.NoteContent);

        mappedDaoFields.put("noteTime",
            com.ourteam.product.requirement.dao.IProductIssueNoteDAO.NoteTime);

        mappedDaoFields.put("noteUserId",
            com.ourteam.product.requirement.dao.IProductIssueNoteDAO.NoteUserId);

        mappedDaoFields.put("noteUserName",
            com.ourteam.product.requirement.dao.IProductIssueNoteDAO.NoteUserName);

        mappedDaoFields.put("noteUserPhoto",
            com.ourteam.product.requirement.dao.IProductIssueNoteDAO.NoteUserPhoto);
    }

    private com.ourteam.product.requirement.dao.ProductIssueNote productIssueNote;

    public ProductIssueNoteBean() {
        super();

        this.productIssueNote = new com.ourteam.product.requirement.dao.ProductIssueNote();
    }

    public ProductIssueNoteBean(
        com.ourteam.product.requirement.dao.ProductIssueNote productIssueNote) {
        super();

        this.productIssueNote = productIssueNote;
    }

    public BeanMap getBeanMap() {
        return new BeanMap(productIssueNote);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.requirement.dao.ProductIssueNote convertToProductIssueNote() {
        return this.productIssueNote;
    }

    public com.ourteam.product.requirement.dao.ProductIssueNote convertTo() {
        return this.productIssueNote;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productIssueNote.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productIssueNote.setId(id);
    }

    /**
     * Get issueId
     *
     * @return long
     */
    public long getIssueId() {
        return (long) this.productIssueNote.getIssueId();
    }

    /**
     * Set issueId
     *
     * @parameter long
     */
    public void setIssueId(long issueId) {
        this.productIssueNote.setIssueId(issueId);
    }

    /**
     * Get noteContent
     *
     * @return String
     */
    public String getNoteContent() {
        return (String) this.productIssueNote.getNoteContent();
    }

    /**
     * Set noteContent
     *
     * @parameter String
     */
    public void setNoteContent(String noteContent) {
        this.productIssueNote.setNoteContent(noteContent);
    }

    /**
     * Get noteTime
     *
     * @return java.util.Date
     */
    public java.util.Date getNoteTime() {
        return (java.util.Date) this.productIssueNote.getNoteTime();
    }

    /**
     * Set noteTime
     *
     * @parameter java.util.Date
     */
    public void setNoteTime(java.util.Date noteTime) {
        this.productIssueNote.setNoteTime(noteTime);
    }

    /**
     * Get noteUserId
     *
     * @return long
     */
    public long getNoteUserId() {
        return (long) this.productIssueNote.getNoteUserId();
    }

    /**
     * Set noteUserId
     *
     * @parameter long
     */
    public void setNoteUserId(long noteUserId) {
        this.productIssueNote.setNoteUserId(noteUserId);
    }

    /**
     * Get noteUserName
     *
     * @return String
     */
    public String getNoteUserName() {
        return (String) this.productIssueNote.getNoteUserName();
    }

    /**
     * Get noteUserPhoto
     *
     * @return String
     */
    public String getNoteUserPhoto() {
        return (String) this.productIssueNote.getNoteUserPhoto();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductIssueNoteBean) == false) {
            return false;
        } // end if

        ProductIssueNoteBean other = (ProductIssueNoteBean) obj;

        boolean isEqual = false;

        com.ourteam.product.requirement.dao.ProductIssueNote tempProductIssueNote =
            other.convertToProductIssueNote();

        if ((tempProductIssueNote == null) || (this.productIssueNote == null)) {
            isEqual = false;
        } else if ((tempProductIssueNote == this.productIssueNote) ||
                tempProductIssueNote.equals(this.productIssueNote)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductIssueNoteBean[] toArray(
        com.ourteam.product.requirement.dao.ProductIssueNote[] aProductIssueNotes) {
        return toArray(aProductIssueNotes, null);
    }

    public static ProductIssueNoteBean[] toArray(
        com.ourteam.product.requirement.dao.ProductIssueNote[] aProductIssueNotes,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductIssueNotes)) {
            return new ProductIssueNoteBean[0];
        }

        int length = aProductIssueNotes.length;

        ProductIssueNoteBean[] beans = new ProductIssueNoteBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductIssueNoteBean(aProductIssueNotes[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductIssueNotes[i] });
            }
        }

        return beans;
    }
}
